<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-L-admin1.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
    <div class="x-body">
        <form id="noticeForm" name="noticeForm" method="post" action="">
            <center><div class="head">
                <div class="log-title"></div>

            </div></center>
            <hr style="height: 10px; border: none; border-top: 10px groove skyblue;">


            <center><div class="form-item1">
                <label>公 告 标 题</label>
                <txt style="position:absolute;z-index:2;line-height:36px;margin-left:20px;font-size:14px;font-family:'微软雅黑';
    display:inline;"></txt>
                <input type="text" class="field1" autocomplete="off" maxlength="200"
                       onblur="check()" id="title" name="title"
                       style="margin-top: 40px" required>
            </div></center>
           <center><div class="form-item2">
                <label>公 告 内 容</label> <input class="field2" type="text" autocomplete="off"
                                              maxlength="200" onblur="checkPwd()"  id="content" name="content"
                                              style="margin-top: 20px" required>
            </div></center>
            <div class="form-item4">
                <label></label> <input class="field4" type="hidden" autocomplete="off"
                                       maxlength="200" onblur="checkPwd()"  id="create_date" name="create_date"
                                       style="margin-top: 20px" required>
            </div>
            <center> <div class="form-item3">
                <label>发 布 人 ID</label> <input class="field3" type="text" autocomplete="off"
                                               maxlength="200" onblur="checkPwd()"  id="user_id" name="user_id"
                                               style="margin-top: 20px" required>
            </div></center>

    <div>
        <center><input id="add" type="button" value="立即发布"></center>
    </div>

    <hr style="border-color: skyblue">
    <div class="bottom">
        <h1 style="font-family: '华文行楷'; font-size: 20px; text-align: center;line-height: 40px;">
        </h1>
    </div>
    </form>
    </div>
    <script>
        $(function () {
            $("#add").click(function () {
                //获取数据 javascript对象  弱类型
                var notice={};
                notice.title=$("#title").val();
                notice.content=$("#content").val();
                notice.create_date=$("#create_date").val();
                notice.user_id=$("#user_id").val();

                $.ajax({
                    url:'/Personnel/notice/addnotice',
                    type:'post',
                    data:JSON.stringify(notice),
                    contentType:"application/json;charset=utf-8",
                    dataType:'json',
                    success:function(d){
                        if(d.fig=="success"){
                            //添加成功
                            location.href="noticelist.html";
                        }else{
                            alert("添加公告信息失败!");
                        }
                    }
                })


            })
        })
    </script>
  </body>

</html>